package com.waterms.dao;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.waterms.model.File;

public class FileDaoImpl extends HibernateDaoSupport implements FileDao{

	@Override
	public void add(File file) {
		getHibernateTemplate().save(file);
	}

	@Override
	public void delete(File file) {
		getHibernateTemplate().delete(file);
	}

	@Override
	public void update(File file) {
		getHibernateTemplate().update(file);
	}

	@Override
	public List<File> list() {
		return getHibernateTemplate().find("from File");
	}

	@Override
	public List<File> list(String fileName) {
		return getHibernateTemplate().find("from File where fileName = ?", fileName);
	}

}
